<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改产品服务')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-product-edit" th:object="${iiProduct}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">logo：</label>
            <div class="col-sm-8">
                <input type="hidden" name="logo" th:field="*{logo}">
                <div class="file-loading">
                    <input class="form-control image-upload" id="logo" name="file" type="file">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">名称：</label>
            <div class="col-sm-8">
                <input name="name" th:field="*{name}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">公司：</label>
            <div class="col-sm-8">
                <input name="company" th:field="*{company}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">网址：</label>
            <div class="col-sm-8">
                <input name="site" th:field="*{site}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">简介：</label>
            <div class="col-sm-8">
                <textarea name="description" class="form-control" type="text" required rows="5">[[*{description}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">内容：</label>
            <div class="col-sm-8">
                <script id="content" name="content" type="text/plain" th:utext="*{content}"></script>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('lk_ii_status')}">
                    <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}" required>
                    <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<th:block th:include="include :: ueditor" />
<th:block th:include="ii/common::image-upload" />
<script th:inline="javascript">
    var prefix = ctx + "ii/product";
    $("#form-product-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-product-edit').serialize());
        }
    }

    $(function() {
        var ue = UE.getEditor('content');
        $("#content").css("height","380px");
    });
</script>
</body>
</html>